package com.umgsai.thread.thread40;

public class ThreadA extends Thread {
	private ThreadB b;
	public ThreadA(ThreadB b) {
		super();
		this.b = b;
	}
	@Override
	public void run() {
		try {
			synchronized (b) {
				System.out.println(Thread.currentThread().getName() + " A begin time = " + System.currentTimeMillis());
				Thread.sleep(5000);
				System.out.println(Thread.currentThread().getName() + " A end time = " + System.currentTimeMillis());
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
